<%--
  $Id: headerInclude.jsp 46 2013-05-03 21:38:12Z gabakyan $
  $Author: gabakyan $
  $Revision: 46 $
  $Date: 2013-05-03 21:38:12 +0000 (Fri, 03 May 2013) $

  Copyright (c) 2013 Supply Chain Intelligence (SCI), Inc.
  http://www.scintelligence.com/, Email: info@scintelligence.com
  All rights reserved.

  This file is part of Logistics Map.

  Logistics Map is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, version 3 of the License.

  Logistics Map is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Logistics Map.  If not, see <http://www.gnu.org/licenses/>.
--%>
<%@ page import="com.sci.logisticsmap.service.model.SessionUserDTModel" %>
<%@ page import="com.sci.logisticsmap.web.security.support.SecurityContextHelper" %>
<spring:eval expression="@deployProperties.getProperty('app.version')" var="appVersion" />
<header>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">
                <%--<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">--%>
                    <%--<span class="icon-bar"></span>--%>
                    <%--<span class="icon-bar"></span>--%>
                    <%--<span class="icon-bar"></span>--%>
                <%--</a>--%>
                <a class="brand" href="<c:url value="/"/>"><span class="nav-logo-link"><!--<i class=""></i>--></span></a>
                <div class="nav-collapse collapse">
                    <%--<ul class="nav pull-right">--%>
                        <%--<%@ include file="/WEB-INF/jsp/includes/languageInclude.jsp"%>--%>
                    <%--</ul>--%>
                    <span class="navbar-text pull-right"><fmt:message key="common.app.version"/> (${appVersion})</span>
                    <%--<p class="navbar-text pull-right">--%>
                    <%--</p>--%>
                    <ul class="nav">
                        <%
                            if (SecurityContextHelper.isAuthenticatedUser(session)) {
                        %>
                        <li class="dropdown"><a href="#" class="navbar-link dropdown-toggle" data-toggle="dropdown"><%--<i class="icon-user icon-white"></i> --%><%
                            //if (SecurityContextHelper.isAuthenticatedUser()) {
                            //SessionUserDTModel sessionUser = SecurityContextHelper.getAuthenticatedUserDTModel();
                            SessionUserDTModel sessionUser = SecurityContextHelper.getAuthenticatedUserDTModel(session);
                            //if (sessionUser != null) {
                            StringBuilder fullNameBuilder = new StringBuilder();
                            fullNameBuilder.append(sessionUser.getFirstName()).append(" ").append(sessionUser.getLastName());
                            //}
                        %><%= fullNameBuilder.toString() %><%--${sessionUserFullName}--%> <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="<c:url value="/admin/profile"/>"><fmt:message key="includes.admin.headerInternalInclude.profile.profile"/></a></li>
                                <li class="divider"></li>
                                <li><a href="<c:url value="/admin/sign-out"/>"><fmt:message key="includes.admin.headerInternalInclude.profile.signOut"/></a></li>
                            </ul>
                        </li>
                        <%
                            } else {
                        %>
                        <li><a href="<c:url value="/sign-in"/>"><fmt:message key="includes.admin.headerInternalInclude.signIn"/></a></li>
                        <%
                            }
                        %>
                    </ul>
                </div>
            </div>

            <div class="container-centered"><h4 class="navbar-text"><fmt:message key="common.app.title"/></h4></div>
        </div>
    </div>
</header>